/*
 *jssdk jsapi所在服务器域名，无需追加'http://'或'https://'
 */
var  urldomain = 'app.gjzwfw.gov.cn/jmopen';
// var  urldomain = '192.168.199.183:8020/Desktop';

function containerType() {
    var sUserAgent = navigator.userAgent.toLowerCase();
    var bIsIpad = sUserAgent.match(/ipad/i) == "ipad";
    var bIsIphoneOs = sUserAgent.match(/iphone os/i) == "iphone os";
    var bIsMidp = sUserAgent.match(/midp/i) == "midp";
    var bIsUc7 = sUserAgent.match(/rv:1.2.3.4/i) == "rv:1.2.3.4";
    var bIsUc = sUserAgent.match(/ucweb/i) == "ucweb";
    var bIsAndroid = sUserAgent.match(/android/i) == "android";
    var bIsCE = sUserAgent.match(/windows ce/i) == "windows ce";
    var bIsWM = sUserAgent.match(/windows mobile/i) == "windows mobile";
    var bIsApp = sUserAgent.indexOf('hanweb') > -1;
    var bIsdingding = sUserAgent.indexOf('dingtalk') > -1;
    var bIsWechat = sUserAgent.indexOf('micromessenger') > -1;
    var bIsAlipay = sUserAgent.indexOf('alipayclient') > -1;

    if(bIsApp) {
        return "hanweb";
    } else if(bIsWechat) {
        return "wechat";
    } else if(bIsAlipay) {
        return "Alipay";
    }else if(bIsdingding) {
        return "dingtalk";
    }else {
        return "web";
    }
}
var container = containerType();
var tmpTag = 'https:' == document.location.protocol ? true : false;

if(container == 'hanweb') {
    if(tmpTag == true) {
        if(typeof $ == 'undefined') {
            document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/jquery-1.8.3.min.js"></script>');
        }
         document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/md5.js"></script>');
              document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/sha1.js"></script>');
        document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/js/indexnew.js"></script>');
        document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/jmportal_SDK.js"></script>');
    } else {
        if(typeof $ == 'undefined') {
            document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/jquery-1.8.3.min.js"></script>');
        }
             document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/md5.js"></script>');
              document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/sha1.js"></script>');
        document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/js/indexnew.js"></script>');
        document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/jmportal_SDK.js"></script>');
    }

} else if(container == 'wechat') {

    if(tmpTag == true) {
        if(typeof $ == 'undefined') {
            document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/jquery-1.8.3.min.js"></script>');
        }
        document.write('<script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>');
        document.write('<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=xOWZlWcTZPK84VcK3Ixzqq9wQ6arTUry"></script>');
        document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/sha1.js"></script>');
        document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/md5.js"></script>');
        document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/alipayjs/aes.js"></script>');
        document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/alipayjs/pad-nopadding.js"></script>');
        document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/wechatjs/indexnew.js"></script>');


    } else {
        if(typeof $ == 'undefined') {
            document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/jquery-1.8.3.min.js"></script>');
        }
        document.write('<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=xOWZlWcTZPK84VcK3Ixzqq9wQ6arTUry"></script>');
        document.write('<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>');
        document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/sha1.js"></script>');
        document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/md5.js"></script>');
        document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/alipayjs/aes.js"></script>');
        document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/alipayjs/pad-nopadding.js"></script>');
        document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/wechatjs/indexnew.js"></script>');
        document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/alipayjs/md5.js"></script>');
    }

}else if(container == 'dingtalk') {

    if(tmpTag == true) {
        if(typeof $ == 'undefined') {
            document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/jquery-1.8.3.min.js"></script>');
        }
        document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/md5.js"></script>');
           document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/sha1.js"></script>');
        document.write('<script src="https://g.alicdn.com/dingding/open-develop/1.6.9/dingtalk.js"></script>');
        document.write('<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=xOWZlWcTZPK84VcK3Ixzqq9wQ6arTUry"></script>');
        document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/dingtalkjs/indexnew.js"></script>');

    } else {
        if(typeof $ == 'undefined') {
            document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/jquery-1.8.3.min.js"></script>');
        }
        document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/md5.js"></script>');
           document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/sha1.js"></script>');
        document.write('<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=xOWZlWcTZPK84VcK3Ixzqq9wQ6arTUry"></script>');
        document.write('<script src="http://g.alicdn.com/dingding/open-develop/1.6.9/dingtalk.js"></script>');
        document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/dingtalkjs/indexnew.js"></script>');
    }

}else if(container == 'Alipay') {
    if(tmpTag == true) {
        if(typeof $ == 'undefined') {
            document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/jquery-1.8.3.min.js"></script>');
        }
        document.write('<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=xOWZlWcTZPK84VcK3Ixzqq9wQ6arTUry"></script>');
        document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/alipayjs/aes.js"></script>');
        document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/md5.js"></script>');
      document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/sha1.js"></script>');

        document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/alipayjs/pad-nopadding.js"></script>');
        document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/alipayjs/indexnew.js"></script>');

    } else {
        if(typeof $ == 'undefined') {
            document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/jquery-1.8.3.min.js"></script>');
        }
        document.write('<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=xOWZlWcTZPK84VcK3Ixzqq9wQ6arTUry"></script>');
        document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/alipayjs/aes.js"></script>');
        document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/md5.js"></script>');
      document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/sha1.js"></script>');
        document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/alipayjs/pad-nopadding.js"></script>');
        document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/alipayjs/indexnew.js"></script>');
    }

}else{
    if(tmpTag == true) {
        if(typeof $ == 'undefined') {
            document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/jquery-1.8.3.min.js"></script>');
        }
        document.write('<script type="text/javascript" src="https://api.map.baidu.com/api?v=2.0&ak=xOWZlWcTZPK84VcK3Ixzqq9wQ6arTUry"></script>');
        document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/md5.js"></script>');
        document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/sha1.js"></script>');
        document.write('<script type="text/javascript" src="https://'+urldomain+'/jssdk/wechatjs/brower.js"></script>');
    } else {
        if(typeof $ == 'undefined') {
            document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/jquery-1.8.3.min.js"></script>');
        }
        document.write('<script type="text/javascript" src="http://api.map.baidu.com/api?v=2.0&ak=xOWZlWcTZPK84VcK3Ixzqq9wQ6arTUry"></script>');
        document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/md5.js"></script>');
        document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/sha1.js"></script>');
        document.write('<script type="text/javascript" src="http://'+urldomain+'/jssdk/wechatjs/brower.js"></script>');
    }

}
var uuid;
var getyyuuid = function(){
    var pageurl = location.href;
    var pagestrs = pageurl.split('/');
    uuid = pagestrs[pagestrs.length - 2];
}
